<#include "/java_copyright.include">
<#assign className = table.className>   
<#assign classNameLower = className?uncap_first> 
package ${basepackage}.dao;

import java.util.List;
import java.util.Map;
import ${basepackage}.dto.${className};
import my.mybatis.common.QueryParams;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
<#include "/java_description.include">
 */
@Repository
public interface ${className}Dao {

	/** 
	 * 创建${className} 
	 * return 数据库受影响的行数
	 * @param ${classNameLower}
	 **/
	public int save(${className} ${classNameLower});
	
	/**
	 * 批量创建${className}
	 * return 数据库受影响的行数
	 * @param list
	 */
	public int saveBatch(List<${className}> list);
	
	/** 
	 * 更新${className}
	 * return 数据库受影响的行数
	 * @param ${classNameLower}
	 **/	
    public int update(${className} ${classNameLower});
	
	/** 
	 * 根据条件queryParams批量更新${className}
	 * return 数据库受影响的行数
	 * @param ${classNameLower}
	 * @param queryParams
	 **/	
    public int updateByQueryParams(@Param("entity") ${className} ${classNameLower},@Param("queryParams") QueryParams<${className}> queryParams);
    
	/** 
	 * 删除${className}
	 * return 数据库受影响的行数
	 * @param id
	 **/
    public int deleteById(${table.idColumn.javaType} id);
	
	/**
	 * 根据条件queryParams批量删除数据
	 * return 数据库受影响的行数
	 * @param queryParams
	 */
	public int deleteByQueryParams(@Param("queryParams") QueryParams<${className}> queryParams);
    
	/** 
	 * 根据ID查询${className}
	 * @param id
	 * return ${className}
	 **/    
    public ${className} findById(${table.idColumn.javaType} id);
	
	/** 
	 * 查询: ${className}
	 * @param queryParams
	 * return List<${className}>
	 **/   
	public List<${className}> findAll(QueryParams<${className}> queryParams);
}
